#@layout()
#define main()
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title  am-cf">行业管理</div>
                </div>
                <div class="widget-body  am-fr">
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    #ifHasAuth("/admin/industry/save")
                                    <a class="am-btn am-btn-default am-btn-success" href="/admin/industry/add"><span class="am-icon-plus"></span> 新增</a>
                                    #end
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-3" style="float:right">
                        <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                            <input type="text" class="am-form-field ">
                            <span class="am-input-group-btn">
                                <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="button"></button>
                            </span>
                        </div>
                    </div>

                    <div class="am-u-sm-12">
                        <link rel="stylesheet" href="/admin/common/Treegrid/css/jquery.treegrid.css">
                        <script src="/admin/common/Treegrid/js/jquery.treegrid.min.js"></script>
                        <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black " id="industry-tree">
                            <thead>
                            <tr>
                                <th>行业名</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            #for(x : industryPage)
                            <tr class="gradeX treegrid-#(x.id) treegrid-parent-#(x.pid==0?'':x.pid)">
                                <td>
                                    #(x.name)
                                </td>
                                <td>
                                    <div class="tpl-table-black-operation">
                                        #ifHasAuth("/admin/industry/update")
                                        <a href="/admin/industry/edit/#(x.id)">
                                            <i class="am-icon-pencil"></i> 编辑
                                        </a>
                                        #end
                                        #ifHasAuth("/admin/industry/save")
                                        <a href="/admin/industry/add?pid=#(x.id)&pname=#(x.name)&level=#(x.level)">
                                            <i class="am-icon-plus"></i> 添加子行业
                                        </a>
                                        #end
                                        #ifHasAuth("/admin/industry/delete")
                                        <a href="/admin/industry/delete/#(x.id)" class="tpl-table-black-operation-del">
                                            <i class="am-icon-trash"></i> 删除
                                        </a>
                                        #end
                                    </div>
                                </td>
                            </tr>
                            #end
                            </tbody>
                        </table>

                        <script>
                            $(function () {
                                $('#industry-tree').treegrid({
                                    expanderExpandedClass: 'am-icon-minus',
                                    expanderCollapsedClass: 'am-icon-plus'
                                });
                            });
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
#end